package com.xy.cli.command.children;

import cn.hutool.core.util.ReflectUtil;
import com.xy.model.DataModel;
import lombok.extern.slf4j.Slf4j;
import picocli.CommandLine;

import java.lang.reflect.Field;

@Slf4j
@CommandLine.Command(name = "config", description = "配置", mixinStandardHelpOptions = true)
public class ConfigCommand implements Runnable {
@Override
public void run() {
log.info("参数信息:");
//反射拿到所有字段
Field[] fields = ReflectUtil.getFields(DataModel.class);
for (Field field : fields) {
System.out.println("字段名称:" + field.getName());
System.out.println("字段类型:" + field.getType());
System.out.println("--------");
}
}
}
